<?php

namespace App\Miya\Traits\Scope;

use Illuminate\Database\Eloquent\Builder;

trait OrderByRankTrait
{
    protected static function boot()
    {
        parent::boot();
        static::addGlobalScope('rank', function (Builder $builder) {
            $builder->orderBy('rank', 'DESC');
        });
    }
}
